package com.itheima.reggie.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.reggie.entity.Category;
import com.itheima.reggie.mapper.CategoryMapper;
import com.itheima.reggie.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public boolean edit(Category category) {
        return updateById(category);
    }

    @Override
    public boolean add(Category category) {
        return save(category);
    }

    @Override
    public Integer getDishOrSetmealIsexist(Long id) {
        return categoryMapper.getDishOrSetmealIsexist(id);
    }
}
